#ifndef INPUTEVENTFILTER_H
#define INPUTEVENTFILTER_H

#include <QObject>
#include <QTimer>
#include <inputlib/inputmanager.h>
#include <inputlib/inputcallback.h>
#include "InputTypes.h"
#include "InputMapping.h"

class InputEventFilter : public QObject, public InputCallback
{
  Q_OBJECT

public:
  InputEventFilter(unsigned int inputsRequested);
  virtual ~InputEventFilter();

  void installInputMapping(InputMapping* mapping);
  virtual void axisEvent(unsigned int input, unsigned int axis, int value);
  virtual void buttonEvent(unsigned int input, unsigned int button, bool pressed);

signals:
  void buttonPress(ButtonType);
  void buttonRelease(ButtonType);
  void axisMovement(HalfAxisType, int);

protected:
  virtual bool eventFilter(QObject *o, QEvent *e);

  InputManager& mInputManager;
  InputMapping* mInputMapping;
};

#endif
